package com.esp.soccertutor.ui;

import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;


import com.esp.soccertutor.R;
import com.esp.soccertutor.util.Const;

public class StartUp extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);// hide window title
        setContentView(R.layout.startup);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        Const.tf= Typeface.createFromAsset(getAssets(),"font/myriadpro-regular.otf");
        ProsseccThread Objthead = new ProsseccThread();
		Objthead.start();
	}
	
	private class ProsseccThread extends Thread {
		@Override
		public void run() {
			while (true) {
				try {
					Thread.sleep(5000);
					this.handler.sendEmptyMessage(0);

				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}

		private Handler handler = new Handler() {
			@Override
			public void handleMessage(android.os.Message msg) {
				ChooseActivity.IsStartUp = true;
				finish();
			}
		};
		
	}
	
}
